// JavaScript Document
var dayarray=new Array("CN","T2","T3","T4","T5","T6","T7");
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12");
function startclock()
{
	var curdate=new Date();
	
	var year=curdate.getYear();//lấy năm
		if (year < 1000) year+=1900;
		
	var day=curdate.getDay();// lấy thứ trong tuần
	
	var month=curdate.getMonth();//lấy tháng
	
	var daym=curdate.getDate();//lấy ngày
		if (daym<10)daym="0"+daym;
		
	var hours=curdate.getHours();
	var minutes=curdate.getMinutes();
	var seconds=curdate.getSeconds();
	var dn="AM";
		if (hours>=12) dn="PM";
		if (hours>12) hours=hours-12;
		if (hours<10) hours="0"+hours;
		if (hours==0) hours=12;
		if (minutes<=9) minutes="0"+minutes;
		if (seconds<=9) seconds="0"+seconds;
	var id;
	id=document.getElementById("clock");
	id.innerHTML=dayarray[day]+", "+daym+"/"+montharray[month]+"/"+year+", "+hours+":"+minutes+":"+seconds+" "+dn;
	setTimeout('startclock()',1000);
}
